package com.whucke.multi.datasource.controller;

import com.whucke.multi.datasource.domain.City;
import com.whucke.multi.datasource.service.ICityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * User Controller
 *
 * @author zhang peng
 * @since 2019/3/6 10:18
 */
@RestController
@RequestMapping("/city")
public class CityController {

    @Autowired
    private ICityService cityService;

    @RequestMapping(value = "/save")
    public Object saveCity(String name) {
        City city = cityService.save(name);
        return city.getId();
    }
}

